<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_id" data-rule="required" data-source="user/user/index" disabled data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Order_sn')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-order_sn" data-rule="required" class="form-control" name="row[order_sn]" disabled type="text" value="{$row.order_sn|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Order_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-order_price" data-rule="required" class="form-control"  disabled step="0.01" name="row[order_price]" type="number" value="{$row.order_price|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Paytime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-paytime" data-rule="required" class="form-control datetimepicker" disabled data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[paytime]" type="text" value="{:$row.paytime?datetime($row.paytime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sendtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sendtime" data-rule="required" class="form-control datetimepicker" disabled data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[sendtime]" type="text" value="{:$row.sendtime?datetime($row.sendtime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Receipttime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-receipttime" data-rule="required" class="form-control datetimepicker" disabled data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[receipttime]" type="text" value="{:$row.receipttime?datetime($row.receipttime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Completetime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-completetime" data-rule="required" class="form-control datetimepicker" disabled data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[completetime]" type="text" value="{:$row.completetime?datetime($row.completetime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Canceltime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-canceltime" data-rule="required" class="form-control datetimepicker" disabled data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[canceltime]" type="text" value="{:$row.canceltime?datetime($row.canceltime):''}">
        </div>
    </div>
    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <th style="text-align: center;vertical-align: middle;" colspan="13">
                <h3 style="color: red;">商品信息</h3>
            </th>
        </tr>
        </thead>
        <tr class="goods-title">
            <th>商品ID</th>
            <th>商品图片</th>
            <th>商品名称</th>
            <th>规格名称</th>
            <th>单价</th>
            <th>数量</th>
        </tr>
        <tbody>
        {foreach name="orderGoods" item="vo"}
        <tr>
            <td style="text-align: center; vertical-align: middle;">{$vo.goods_id}</td>
            <td style="text-align: center; vertical-align: middle; "><a href="javascript:"><img class="img-sm img-center" src="{$vo.images}"></a></td>
            <td style="text-align: center; vertical-align: middle;">{$vo.goods_name}</td>
            <td style="text-align: center; vertical-align: middle;">{$vo.sku_name}</td>
            <td style="text-align: center; vertical-align: middle;">{$vo.goods_price}</td>
            <td style="text-align: center; vertical-align: middle;"> {$vo.goods_num}</td>
        </tr>
        {/foreach}

        </tbody>
    </table>
    <table class="table table-bordered ">
        <thead >
        <th style="text-align: center;">
            下单人：{$userInfo.username}
        </th>


        </thead>
    </table>
    <thead>
    <tr>
        <th style="text-align: center;vertical-align: middle;" colspan="13">
            <h3 style="color: red;">收货信息</h3>
        </th>
    </tr>
    </thead>
    <table class="table table-bordered ">
        <thead >
        <th style="text-align: center;">
            收货人：{$row.addressInfo.name}
        </th>
        <th style="text-align: center;">
            联系方式：{$row.addressInfo.phone}
        </th>
        <th style="text-align: center;">
            地址：{$row.addressInfo.province}{$row.addressInfo.city}{$row.addressInfo.area}
        </th>
        <th style="text-align: center;">
            详细地址：{$row.addressInfo.address}
        </th>
        </thead>
    </table>



    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择快递')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-logistic_code" data-rule="required" {$row.status=='2'?'':'disabled'}  class="form-control selectpicker" name="row[logistic_code]">
                {foreach name="logistic" item="vo"}
                <option value="{$vo.name}" {in name="vo.name" value="$row.logistic_code"}selected{/in}>{$vo.name}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('快递号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-logistic_num"  {$row.status=='2'?'':'disabled'} class="form-control"  name="row[logistic_num]" type="text" value="{$row.logistic_num|htmlentities}">
        </div>
    </div>
    {if $row.status==2}

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('是否发货')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                <label ><input  name="row[status]" type="radio" value="3"  /> 是</label>
                <label><input  name="row[status]" type="radio" value="2"  checked/> 不是</label>
            </div>

        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('当前订单状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                {foreach name="statusList" item="vo"}
                {if $key==$row.status}
                <input id="c-status"  class="form-control"  disabled type="text" value="{$vo|htmlentities}">
                {/if}
                {/foreach}
                {eq name="$row.status" value="6"}
                    <input id="c-status"  class="form-control"  disabled type="text" value="退货">
                {/eq}
            </div>
        </div>
    </div>
    {if condition="$row.status eq 6"}
        <hr>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-12" style="text-align: center;">
            <h3 style="color: red;margin: 0;">退货信息</h3></label>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('退货类型')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input class="form-control"  disabled type="text" value="{:$refundInfo['types']==1 ? '退货退款' : '退款'}">
            </div>
        </div>
        {eq name="$refundInfo.types" value="1"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('货物状态')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input class="form-control"  disabled type="text" value="{:$refundInfo['is_cargo']==1 ? '未收货' : '已收货'}">
                </div>
            </div>
        {/eq}
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('退货原因')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input class="form-control"  disabled type="text" value="{$refundInfo.reason}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('退货描述')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea class="form-control" rows="5" disabled>{$refundInfo.reason_desc}</textarea>
                {foreach name="$refundInfo.images" item="vo"}
                    <span style="width: 110px;height: 110px;padding: 5px;display: flex;">
                        <a target="_blank" href="{$vo}"><img src="{$vo}" style="width: 100%;height: 100%;"></a>
                    </span>
                {/foreach}
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('联系电话')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input class="form-control"  disabled type="text" value="{$row.user.mobile}">
            </div>
        </div>
        {eq name="$refundInfo.status" value="1"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('退货申请')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="radio">
                        <label for="refund[status]-2"><input id="refund[status]-2" name="refund[status]" type="radio" value="2" checked /> 同意</label> 
                        <label for="refund[status]--1"><input id="refund[status]--1" name="refund[status]" type="radio" value="-1" {in name="-1" value="$refundInfo.status"}checked{/in} /> 拒绝</label> 
                    </div>
                    <small>（如选择"同意"：请主动联系客户进行退款操作）</small>
                    <input type="hidden" name="refund[id]" value="{$refundInfo.id}">
                </div>
            </div>
        {else/}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('退货状态')}:</label>
                <div class="col-xs-12 col-sm-8">
                    {switch name="$refundInfo.status" }
                        {case value="2"}
                            <input class="form-control"  disabled type="text" value="已通过">
                        {/case}
                        {case value="3"}
                            <input class="form-control"  disabled type="text" value="已打款">
                        {/case}
                        {case value="4"}
                            <input class="form-control"  disabled type="text" value="撤销申请">
                        {/case}
                        {case value="-1"}
                            <input class="form-control"  disabled type="text" value="已拒绝">
                        {/case}
                        {default /}
                    {/switch}
                </div>
            </div>
        {/eq}
    {/if}

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
